package com.shujia

import scala.io.Source

object Demo27Implicit {

  def main(args: Array[String]): Unit = {

    /**
      * 隐式转换参数
      *
      */


    def fun(str: String): String => Unit = {

      def f(per: String): Unit = {

        println(per + "\t" + str)
      }
      //返回函数
      f
    }


    fun("java")("string")

    //简写
    def fun1(str: String)(implicit per: String): Unit = {
      println(per + "\t" + str)
    }

    //定义隐式转换变量
    implicit val s: String = "asdasd"

    fun1("java")



  }
}
